package com.project.dto;

import lombok.Data;

@Data
public class WebserviceR {
    public int total;
    public boolean success;
    public String datas;
    public String errorMessage;

    public static WebserviceR success(int total,String datas) {
        WebserviceR r = new WebserviceR();
        r.total = total;
        r.success = true;
        r.datas = datas;
        return r;
    }
    public static WebserviceR success(String datas) {
        WebserviceR r = new WebserviceR();

        r.success = true;
        r.datas = datas;
        return r;
    }

    public static WebserviceR fail(String errorMessage) {
        WebserviceR r = new WebserviceR();
        r.success = false;
        r.errorMessage = errorMessage;
        return r;
    }
}
